package com.gitee.limaozhi.socket.lesson03.example1;

import java.util.ArrayList;
import java.util.List;

/**
 * @author hzlimaozhi
 * @date 2019/08/26 15:15
 */
public class ClientLogicHandler {

    private static List<String> requests = new ArrayList<>();
    static {
        requests.add("你好！");
        requests.add("今天温度多少？");
        requests.add("明天什么天气？");
        requests.add("拜拜！");
    }

    private int count = 0;

    /**
     * 按顺序发送请求
     */
    public String getRequest() {
        if (count >= requests.size()) {
            return null;
        } else {
            return requests.get(count++);
        }
    }

}
